Websydian v6.1 online documentationOnline documentation - WebsydianExpress v3.5

Meta templates include hierarchy

Overview

This document describes the include structure of the meta templates that are a crucial part of the generation of your final templates to be used by the page generator.

Overall structure

Structure of meta templates

Call structure when processing Meta Templates

This structure displays each available meta template and how you are able to include these into each other. Each meta template reflects an element in the XML document created by the _CreateTemplate function from your model.

It all starts at the top with the Main meta template which then will include any of the meta templates scoped to it. Each meta template is described below in detail.

A note on the coloring of the structure. The top meta templates and meta templates that are only used once in the structure is grey the other colors depict meta templates that are reused throughout the structure. Especially the FieldValues meta template (Orange) is reused in multiple places.

Each of the meta templates will read data for a specific element in the XML document - and call any child meta templates specified by a %INCLUDE maker. Note that each meta template can contain several %INCLUDE markers specifying the same child page but with different meta templates.

Main

MetaTemplate Main
Meta template name MAIN
Meta template type Detail page only
Current XML element Page

When the template generator is called it will search for any occurrences of the meta template MAIN.xxx in the meta template folder specified and then create a final template for each of these MAIN meta template replacing the MAIN with the implementation name of the PageGenerator.

E.g. MAIN.js will become myImplName.js and MAIN.htm will become myImplName.htm

Always remember that the starting point of any template generation is the MAIN meta template.

During the processing of the MAIN meta template information about the Page element from the XML document is easily accessible as this is the current element for the MAIN meta template.

The MAIN meta templates points to the Page element of the XML document in the details region of the meta template

The following examples shows how to obtain values from the Page element in the MAIN meta template

/(%GETVALUE-@plex_impl) /* Will return the value ALBDLTPG */
/(%GETVALUE-@wsypagetitle) /* Will return the value Confirm delete */

In the Main meta template you are able to include the following meta templates.

ChildPages

MetaTemplate Main
Meta template name CHILDPAGES
Meta template type Detail and Grid page
Current XML element Detail element is the Region element (with attribute named plex_name equal WsyDetails)
Grid element is the ChildPage element being processed

The ChildPages meta template enables you to iterate over any available child pages defined for the page. The current element for the detail region (outside the <!--/(GRID--> marker) is the Region element of the XML document where the attribute plex_name equals WsyDetails. The current element for the grid element (inside the <!-/(GRID)--> marker is the current ChildPage element being processed.

Current element for detail region is the Region element with attribute plex_name equal WsyDetails and for the grid region it is the ChildPage element for each available child.

GridFields

MetaTemplate Main
Meta template name GRIDFIELDS
Meta template type Detail and Grid page
Current XML element Detail element is the Region element (with attribute named plex_name equal WsyGrid)
Grid element is the Field element being processed

This meta template enables you to read all the field elements that are scoped by the WsyGrid region of the XML document. The retrieved data is used to populate the grid of the page. 

Current element for the detail region is the Region element with attribute plex_name equal WsyGrid and for the grid region it is the Field element for each available Field.

Field

MetaTemplate Main
Meta template name FIELD
Meta template type Detail only
Current XML element Detail element is the Field element being processed.
Included in GridFields, DetailFields

The field meta template can be included in either of the GridFields or DetailFields meta templates. It enables you to process a specific field from within the grid region of its parent meta template. Where in this case the parent meta template is either the GridFields meta template or the DetailFields meta template. 

The following picture shows two possible locations of detail elements handled by the Field PageGenerator)

The current element is the Field being processed as linked by the parent in which the Field meta template is included

FieldValues

MetaTemplate Main
Meta template name FIELDVALUES
Meta template type Detail and Grid page
Current XML element Detail element is the Values element scoped to the Field element
Grid element is the current value being processed in the grid.
Included in GridFields,Field,EventFields,EventField,DetailFields 

The FieldValues meta template will iterate through all available values.

Current element for the detail region is the Values element and for the grid region it is the Value element.

DetailEvents

MetaTemplate Main
Meta template name DETAILEVENTS
Meta template type Detail and Grid page
Current XML element Detail element is the Region element with attribute plex_name euqaul to WsyDetails
Grid element is the current Event element being processed
Included in Main 

This meta template iterates all Event elements in the WsyDetails region and uses them to populate the grid.

Current detail element is the Region element with plex_name equal to WsyDetails and the current grid element is the Event element being processed.

DetailEvent

MetaTemplate Main
Meta template name DETAILEVENT
Meta template type Detail only
Current XML element Detail element is the Event element being processed.
Included in DetailEvents

This meta template reads information for one specific Event element. This event will be scoped by the WsyDetails region.

Current element is the actual Event element as set by the meta template parent

EventFields

MetaTemplate Main
Meta template name EVENTFIELDS
Meta template type Detail and Grid page
Current XML element Detail element is the Event being processed
Grid element is the actual Field of the Event being processed
Included in DetailEvent, GridEvent

This meta template iterates through all the Field elements scoped by a specific Event element and uses them to populate the grid.

Current detail element is the Event and the current grid element is the Field being processed

EventField

MetaTemplate Main
Meta template name EVENTFIELD
Meta template type Detail only
Current XML element Detail event is the Field element being processed by the meta template parent EventFields
Included in EventFields

This meta template reads all information about a specific Field element that is scoped by an Event element.

Current element is the Field element being processed by the meta template parent EventFields

GridEvents

MetaTemplate Main
Meta template name GRIDEVENTS
Meta template type Detail and Grid page
Current XML element Detail element is the Region element with attribute plex_name euqaul to WsyGrid
Grid element is the current Event element being processed
Included in Main 

This meta template iterates the Event elements in the WsyGrid region and uses them to populate the grid.

Current detail element is the Region element where WsyGrid is the value of attribute plex_name and the current grid element is the actual Event being processed.

GridEvent

MetaTemplate Main
Meta template name GRIDEVENT
Meta template type Detail only
Current XML element Current element is the Event being processed by the meta template parent GridEvents
Included in GridEvents

This meta template reads all information about a specific Event element in the WsyGrid region.

Current element is the Event element being processed by the parent meta template GridEvents

DetailFields

MetaTemplate Main
Meta template name DETAILFIELDS
Meta template type Detail and Grid page
Current XML element Detail element is the Region element with attribute plex_name equal to WsyDetails
Grid element is the current Field element being processed
Included in Main

This meta template iterates all the Field elements in the WsyGrid region and uses them to populate the grid.

Current detail element is the Region element where value of attribute plex_name is WsyDetails and the current grid element is the Field being processed.